package com.ruoyi.system.service.impl;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Service;

@Service
public class PlanMessageService {

    private final SimpMessagingTemplate messagingTemplate;

    @Autowired
    public PlanMessageService(SimpMessagingTemplate messagingTemplate) {
        this.messagingTemplate = messagingTemplate;
    }

    // 监听 RabbitMQ 队列
//    @RabbitListener(queues = "plan.manager")
//    public void handlePlanMessage(String message) {
//
//        System.out.println("消息发送成功：Received message: " + message);
//        // 将消息转发到 WebSocket 的 /topic/plan
//        messagingTemplate.convertAndSend("/ws/plan", message);
//    }
}
